﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;
using Pampa.CRUD.Core;

namespace Pampa.MVC.Data
{
    public class TransactionCastle : ITransaction
    {
        private TransactionScope _transaction;

        public TransactionCastle()
        {
            _transaction = new TransactionScope(OnDispose.Rollback);
        }

        public void Dispose()
        {
            _transaction.Dispose();
        }

        public void Commit()
        {
            _transaction.VoteCommit();
        }

        public void Rollback()
        {
            _transaction.VoteRollBack();
        }
    }
}
